describe('testAPI', function () {
  describe('Test URL', function () {
    it('should succeed', function () {
      this.timeout(0);//时间设置成无限
      const assert = require("assert");
      const request = require("request-promise");
      return request("http://localhost:1116/query/layer/name", {
        qs: {
          layerName: "JZXH",
          queryName: "时尚创意园"
        },
        json: true
      }).then(function (body) {
        assert.equal(body.respCode, 0);
      });
    });
    //未完，待续
    it('should succeed', function () {
      this.timeout(0);//时间设置成无限
      const assert = require("assert");
      const request = require("request-promise");
      return request("http://localhost:1116/query/match/layer/name", {
        qs: {
          layername: "HD",
          queryname: "河"
        },
        json: true
      }).then(function (body) {
        assert.equal(body.respCode, 0);
      });
    });
    //测试距离
    it('should succeed', function () {
      this.timeout(0);//时间设置成无限
      const assert = require("assert");
      const request = require("request-promise");
      return request("http://localhost:1116/query/measure/geometry", {
        qs: {
          geos: "121.16316714473389,31.032622836275717,121.14261621097981,31.02078912234387"
        },
        json: true
      }).then(function (body) {
        assert.equal(body.respCode, 0);
      });
    });

    it.only('should succeed', function () {
      this.timeout(0);//时间设置成无限
      const assert = require("assert");
      const request = require("request-promise");
      return request("http://localhost:1116/query/name/round", {
        qs: {
          queryName:"昆港路",
          distance: "100",
        },
        json: true
      }).then(function (body) {
        assert.equal(body.respCode, 0);
      });
    });



    it('should succeed', function () {
      this.timeout(0);//时间设置成无限
      const assert = require("assert");
      const request = require("request-promise");
      return request("http://localhost:1116/query/layer/name/border", {
        qs: {
          layerName: "DL",
          queryName: "昆港路"
        },
        json: true,
        resolveWithFullResponse: true
      }).then(function (response) {
        assert.equal(response.headers["access-control-allow-origin"], "*");
        assert.equal(response.body.respCode, 0);
      });
    });

    //新加，测试道路周围
    it('should succeed', function () {
      this.timeout(0);//时间设置成无限
      const assert = require("assert");
      const request = require("request-promise");
      return request("http://localhost:1116/query/layer/name", {
        qs: {
          queryName: "昆港路"
        },
        json: true
      }).then(function (body) {
        assert.equal(body.respCode, 0);
      });
    });


  });
});